home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TeX 1995 July
/
TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO
/
dviware
/
dvi2pcl
/
storechar.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-24
|
1KB
|
45 lines
/*
* Does similar things as down_character, but instead of putting
* the character's pixel pattern in the bitfile it is stored in dynamicaly
* allocated memory, used for drawing the character in graphic mode. In
* graphic mode the meaning for x_offset and y_offset is different from
* downloaded characters and the pixel pattern is stripped off from pending
* zero bytes in each row.
*/
#include "globals.h"
void storechar(c)
int c;
{
byte *q, *p;
int i;
int width;
int height;
long length;
gcharfmt *g;
pktopxl(c);
g = &(*gfont)[c];
if(landscape) {
p = (byte *)rotatechar();
g->pxl_bytes = width = (c_height + 7)/8;
g->pxl_rows = height = c_width;
g->x_offset = height - c_hoffset - 1;
g->y_offset = -c_voffset;
}
else {
p = (byte *) pxlbuffer;
g->pxl_bytes = width = (c_width + 7)/8;
g->pxl_rows = height = c_height;
g->x_offset = -c_hoffset;
g->y_offset = -c_voffset;
}
length = height*width;
g->pxl_pattern = (byte *)malloc(length);
q = g->pxl_pattern;
for(i = 0 ; i < length ; i ++)
*q++ = *p++;
}